package model

import "gorm.io/gorm"

// 商品表
type Goods struct {
	gorm.Model
	Name  string  `gorm:"type:varchar(50);not null;comment:商品名称"`
	Price float32 `gorm:"type:decimal(10,2);not null;comment:商品价格"`
	Image string  `gorm:"type:varchar(100);not null;comment:商品图片"`
	Stock int32   `gorm:"type:int(11);not null;comment:库存"`
}

// 订单表
type Order struct {
	gorm.Model
	UserId  int32   `gorm:"type:int(11);not null;comment:用户ID"`
	GoodsId int32   `gorm:"type:int(11);not null;comment:商品ID"`
	Price   float32 `gorm:"type:decimal(10,2);not null;comment:订单金额"`
	PayType int32   `gorm:"type:int(11);comment:支付方式,1.支付宝,2.微信"`
	Status  string  `gorm:"type:varchar(50);comment:支付状态:WAIT_BUYER_PAY(等待付款),TRADE_CLOSED(退款),TRADE_SUCCESS(支付成功),TRADE_FINISHED(交易结束)"`
	OrderSn string  `gorm:"type:varchar(100);not null;comment:订单编号"`
	TradeNo string  `gorm:"type:varchar(100);comment:订单编号"`
	Num     int32   `gorm:"type:int(11);not null;comment:数量"`
}
